main(n,m,t)
{
	for(gets(&m);~scanf("%d",&m);printf("%d/%d\n",n%2?n-t+1:t,n%2?t:n-t+1))
		n=ceil(sqrt(1+8*m)/2-.5),t=m-n*(n-1)/2;
}
